#include "form.h"
#include "ui_form.h"
#include "QPainter"

Form::Form(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form)
{
    ui->setupUi(this);
    this->setGeometry(QRect(600,100,600,1200));
    ui->label_2->setAttribute(Qt::WA_TransparentForMouseEvents, true);
    ui->label_3->setAttribute(Qt::WA_TransparentForMouseEvents, true);

}

Form::~Form()
{
    delete ui;
}

void Form::on_pushButton_clicked()
{
    b.show();
    b.setWindowTitle("俄罗斯方块");
}
void Form::on_pushButton_2_clicked()
{
    c.show();
    c.setWindowTitle("俄罗斯方块");
}
void Form::paintEvent(QPaintEvent *event)
{
    QPainter painters(this);
    //绘制背景
    painters.setPen(Qt::darkBlue);//画笔颜色
    painters.setBrush(Qt::black);//填充颜色
    painters.drawRect(10,10,580,1180);
    painters.drawPixmap(10,10,580,1180,QPixmap(":/images/pictures/picture3.jpg"));
}


